package day04;

import java.util.Scanner;

public class Practice {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请选择功能：1.取款  2.存款 3.查询余额 4.退出成功");
        int command = scan.nextInt();

        switch (command) {
            case 1:
                System.out.println("取款操作...");
                break;
            case 2:
                System.out.println("存款操作...");
                break;
            case 3:
                System.out.println("查询余额操作...");
                break;
            case 4:
                System.out.println("退出成功...");
                break;
            default:
                System.out.println("输入错误");
        }


        int num = (int) (Math.random() * 1000 + 1);
        System.out.println("答案:"+num);
        System.out.println("请输入一个0-1000的整数");
        int guess = scan.nextInt();
        while (guess != num) {
            if (guess > num) {
                System.out.println("猜大了");
            } else {
                System.out.println("猜小了");
            }
            System.out.println("猜吧");
            guess = scan.nextInt();
        }
        System.out.println("恭喜你猜对了");


        int num1 = (int) (Math.random() * 1000 + 1);
        System.out.println("答案:"+num1);
        System.out.println("请输入一个0-1000的整数");
        int guess1;
        do {
            System.out.println("猜吧");
            guess1 = scan.nextInt();
            if (guess1 > num1) {
                System.out.println("猜大了");
            } else if (num1 < guess1) {
                System.out.println("猜小了");
            } else {
                System.out.println("恭喜你猜对了");
            }
        } while (guess1 != num1);

        for (int times = 0; times < 5; times++) {
            System.out.println("行动是成功的阶梯");
        }
        for (int num2 = 1; num2 <=9 ; num2++) {
            System.out.println(num2+"*9="+num2*9);
        }
        for (int num3 = 1; num3 <=9 ; num3+=2) {
            System.out.println(num3+"*9="+num3*9);
        }
        for (int num4 = 9; num4>=1 ; num4--) {
            System.out.println(num4+"*9="+num4*9);
        }

    }
}
